/* AI分析动画效果 */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 加载动画组件 */
.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid #f0f0f0;
  border-top: 3px solid #1890ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* 结果显示区域 */
.analysis-result {
  animation: fadeIn 0.5s ease-in;
}

/* 按钮悬停效果 */
.analysis-button {
  transition: all 0.3s ease;
}

.analysis-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.analysis-button:active {
  transform: translateY(0);
}

/* 打字机效果 */
.typewriter {
  overflow: hidden;
  white-space: pre-wrap;
  animation: fadeIn 0.5s ease-in;
}

/* Markdown内容增强样式 */
.analysis-result h1,
.analysis-result h2,
.analysis-result h3,
.analysis-result h4,
.analysis-result h5,
.analysis-result h6,
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  line-height: 1.4;
  margin-top: 1.5em;
  margin-bottom: 0.8em;
  font-weight: 600;
}

/* 标题样式 */
.analysis-result h1,
.markdown-content h1 {
  color: #1890ff;
  font-size: 2em;
  border-bottom: 2px solid #1890ff;
  padding-bottom: 0.3em;
}

.analysis-result h2,
.markdown-content h2 {
  color: #52c41a;
  font-size: 1.6em;
  border-bottom: 1px solid #d9f7be;
  padding-bottom: 0.2em;
}

.analysis-result h3,
.markdown-content h3 {
  color: #fa8c16;
  font-size: 1.3em;
}

.analysis-result h4,
.markdown-content h4 {
  color: #722ed1;
  font-size: 1.1em;
}

.analysis-result h5,
.markdown-content h5 {
  color: #eb2f96;
  font-size: 1em;
}

.analysis-result h6,
.markdown-content h6 {
  color: #531dab;
  font-size: 0.9em;
}

.analysis-result p,
.markdown-content p {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #333;
}

.analysis-result strong,
.analysis-result b,
.markdown-content strong,
.markdown-content b {
  font-weight: 700 !important;
  background: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: #1890ff;
  padding: 1px 2px;
  border-radius: 2px;
}

.analysis-result em,
.analysis-result i,
.markdown-content em,
.markdown-content i {
  color: #722ed1;
  font-style: italic;
}

.analysis-result blockquote,
.markdown-content blockquote {
  position: relative;
  padding-left: 16px;
  margin: 16px 0;
  color: #666;
}

.analysis-result blockquote::before,
.markdown-content blockquote::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #1890ff 0%, #722ed1 100%);
  border-radius: 2px;
}

.analysis-result ul,
.markdown-content ul {
  list-style-type: none;
  padding-left: 0;
}

.analysis-result ul li,
.markdown-content ul li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 6px;
}

.analysis-result ul li::before,
.markdown-content ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #1890ff;
  font-weight: bold;
  font-size: 16px;
}

.analysis-result ol,
.markdown-content ol {
  counter-reset: list-counter;
}

.analysis-result ol li,
.markdown-content ol li {
  counter-increment: list-counter;
  margin-bottom: 6px;
  padding-left: 24px;
  position: relative;
}

.analysis-result ol li::before,
.markdown-content ol li::before {
  content: counter(list-counter) ".";
  position: absolute;
  left: 0;
  font-weight: bold;
  color: #1890ff;
}

.analysis-result code,
.markdown-content code {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  color: #d63384;
  padding: 3px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.analysis-result pre,
.markdown-content pre {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.analysis-result pre code,
.markdown-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  box-shadow: none;
}

.analysis-result table,
.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.analysis-result thead th,
.markdown-content thead th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: bold;
  text-align: left;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
}

.analysis-result td,
.markdown-content td {
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  text-align: left;
}

.analysis-result tbody tr:nth-child(even),
.markdown-content tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

.analysis-result tbody tr:hover,
.markdown-content tbody tr:hover {
  background-color: #e3f2fd;
  transition: background-color 0.2s ease;
}

.analysis-result a,
.markdown-content a {
  color: #1890ff;
  text-decoration: none;
  position: relative;
  transition: color 0.2s ease;
}

.analysis-result a:hover,
.markdown-content a:hover {
  color: #40a9ff;
  text-decoration: underline;
}

.analysis-result a::after,
.markdown-content a::after {
  content: '↗';
  font-size: 0.8em;
  margin-left: 4px;
  opacity: 0.6;
}

.analysis-result hr,
.markdown-content hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, #1890ff, transparent);
  margin: 24px 0;
  position: relative;
}

.analysis-result hr::before,
.markdown-content hr::before {
  content: '✨';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #fafafa;
  padding: 0 8px;
  color: #1890ff;
}

/* 高亮特殊内容 */
.analysis-result .highlight,
.markdown-content .highlight {
  background: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.analysis-result .warning,
.markdown-content .warning {
  background: linear-gradient(120deg, #ffecd2 0%, #fcb69f 100%);
  padding: 2px 6px;
  border-radius: 4px;
  color: #d4380d;
}

.analysis-result .success,
.markdown-content .success {
  background: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%);
  padding: 2px 6px;
  border-radius: 4px;
  color: #389e0d;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .analysis-result {
    padding: 12px;
    font-size: 13px;
  }

  .analysis-result h1,
  .markdown-content h1 { font-size: 20px; }

  .analysis-result h2,
  .markdown-content h2 { font-size: 18px; }

  .analysis-result h3,
  .markdown-content h3 { font-size: 16px; }

  .analysis-result h4,
  .markdown-content h4 { font-size: 15px; }

  .analysis-result h5,
  .markdown-content h5 { font-size: 14px; }

  .analysis-result h6,
  .markdown-content h6 { font-size: 13px; }
}